fix(tests): replace hardcoded API key values to resolve SAST findings#406
Open
BolotnyaBoss wants to merge 2 commits into
Open
fix(tests): replace hardcoded API key values to resolve SAST findings#406BolotnyaBoss wants to merge 2 commits into
BolotnyaBoss wants to merge 2 commits into
Conversation
added 2 commits
July 3, 2026 16:21
Replace 'test-key' with '' in AgentCLI-effort.test.ts (neither test asserts on apiKey) and 'some-key' with 'placeholder' in moonshot-subscription.template.test.ts (consistent across input and assertion pairs). Resolves EPMCDME-13309, EPMCDME-13310, EPMCDME-13311, EPMCDME-13312
Plan, technical analysis, code review, QA report, and complexity assessment for EPMCDME-13309/13310/13311/13312.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves four SAST
HardcodedNonCryptoSecretfindings flagged by the security scanner. The scanner flags API-key-like field names paired with any non-empty string value in test fixtures, even when the values are clearly fake. The fix replaces the flagged values with alternatives that satisfy the TypeScript type contract and preserve test intent without triggering the pattern.Changes
src/agents/core/__tests__/AgentCLI-effort.test.ts—apiKey: 'test-key'→apiKey: ''(×2); neither test asserts onapiKey, so an empty string is the minimal valid inputsrc/providers/plugins/moonshot-subscription/__tests__/moonshot-subscription.template.test.ts—KIMI_MODEL_API_KEY: 'some-key'→'placeholder'(×4, including matching assertions); value kept consistent between input and immutability assertionTesting
npm run test:unit— 2205 passed, 1 skipped (145 files)npm run test:integration— 220 passed, 1 skipped (27 files)npm run lint— 0 errors, 0 warningsnpm run typecheck— no diagnosticsnpm run build— cleannpm run validate:secrets— no leaks foundChecklist
npm run ci)mainCloses EPMCDME-13309, EPMCDME-13310, EPMCDME-13311, EPMCDME-13312